//新建一个ts专门放置几何与纹理信息，创建一个组整体进行输出

//声明关键字？的引入
import { Mesh, BoxBufferGeometry, MeshStandardMaterial, SphereBufferGeometry, CylinderBufferGeometry, Object3D, Color } from 'three'

//创建一个数组为空  类型为Object3D[]的数组
export const objectList: Object3D[] = []
//声明一个材质变量装载程序
const material = new MeshStandardMaterial({ color: 'red' })

//export将参数输出
export const box: Mesh = new Mesh(
    new BoxBufferGeometry(20, 20, 20),
    //new MeshStandardMaterial({ color: 'rgb(255,100,100)' })
    //使用材质变量
    material
)

export const sphere: Mesh = new Mesh(
    new SphereBufferGeometry(5),
    new MeshStandardMaterial({ color: 'rgb(255,200,100)' })
    //new MeshStandardMaterial({ color: 'red' }) //直接设置颜色
)

export const cylinder: Mesh = new Mesh( //网格物体
    new CylinderBufferGeometry(10, 5, 20, 6),//几何对象
    new MeshStandardMaterial({ color: 'rgb(255,200,200)' })//网格标准材质
)


sphere.position.x = 10
box.position.x = -10
cylinder.position.x = -40

objectList.push(box, sphere, cylinder)